﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraScript : MonoBehaviour {

    public Transform FocusTrans;
    public float MinX = 0f;
    public float MaxX = 0f;

    public static CameraScript sCameraScript;

    void Awake()
    {
        sCameraScript = this;
    }

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
        if (FocusTrans != null)
        {
            float focusX = FocusTrans.position.x;
            focusX = Mathf.Clamp(focusX, MinX, MaxX);
            this.transform.position = new Vector3(focusX, 0, -10);
        }
	}
}
